package com.iteaj.network.message;

import com.iteaj.network.AbstractMessage;
import com.iteaj.network.AbstractProtocol;
import io.netty.buffer.ByteBuf;
import org.springframework.lang.NonNull;

import java.io.IOException;

public abstract class UnParseBodyMessage extends AbstractMessage {

    public UnParseBodyMessage(byte[] message) {
        super(message);
    }

    @Deprecated
    public UnParseBodyMessage(ByteBuf byteBuf) {
        super(byteBuf);
    }

    public UnParseBodyMessage(@NonNull MessageHead head) {
        this(head, VOID_MESSAGE_BODY);
    }

    public UnParseBodyMessage(@NonNull MessageHead head, @NonNull MessageBody body) {
        super(head, body);
        this.messageHead = head;
        this.messageBody = body;
    }

    @Override
    public UnParseBodyMessage build() throws IOException {
        return (UnParseBodyMessage) super.build();
    }
}
